package gson.gson.cclass;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldNamingStrategy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonBuilderExample {
    private final GsonBuilder gsonBuilder;

    public GsonBuilderExample() {
        gsonBuilder = new GsonBuilder();
    }

    public GsonBuilderExample addDeserializationExclusionStrategy(ExclusionStrategy strategy) {
        gsonBuilder.addDeserializationExclusionStrategy(strategy);
        return this;
    }

    public GsonBuilderExample addSerializationExclusionStrategy(ExclusionStrategy strategy) {
        gsonBuilder.addSerializationExclusionStrategy(strategy);
        return this;
    }

    public GsonBuilderExample disableHtmlEscaping() {
        gsonBuilder.disableHtmlEscaping();
        return this;
    }

    public GsonBuilderExample disableInnerClassSerialization() {
        gsonBuilder.disableInnerClassSerialization();
        return this;
    }

    public GsonBuilderExample enableComplexMapKeySerialization() {
        gsonBuilder.enableComplexMapKeySerialization();
        return this;
    }

    public GsonBuilderExample excludeFieldsWithModifiers(int... modifiers) {
        gsonBuilder.excludeFieldsWithModifiers(modifiers);
        return this;
    }

    public GsonBuilderExample excludeFieldsWithoutExposeAnnotation() {
        gsonBuilder.excludeFieldsWithoutExposeAnnotation();
        return this;
    }

    public GsonBuilderExample registerTypeAdapter(Class<?> type, Object typeAdapter) {
        gsonBuilder.registerTypeAdapter(type, typeAdapter);
        return this;
    }

    public GsonBuilderExample registerTypeHierarchyAdapter(Class<?> baseType, Object typeAdapter) {
        gsonBuilder.registerTypeHierarchyAdapter(baseType, typeAdapter);
        return this;
    }

    public GsonBuilderExample serializeNulls() {
        gsonBuilder.serializeNulls();
        return this;
    }

    public GsonBuilderExample setDateFormat(int style) {
        gsonBuilder.setDateFormat(style);
        return this;
    }

    public GsonBuilderExample setExclusionStrategies(ExclusionStrategy... strategies) {
        gsonBuilder.setExclusionStrategies(strategies);
        return this;
    }

    public GsonBuilderExample setFieldNamingStrategy(FieldNamingStrategy fieldNamingStrategy) {
        gsonBuilder.setFieldNamingStrategy(fieldNamingStrategy);
        return this;
    }

    public GsonBuilderExample setPrettyPrinting() {
        gsonBuilder.setPrettyPrinting();
        return this;
    }


    public Gson create() {
        return gsonBuilder.create();
    }
}
